package zone

import (
	"supervideo/app/models"
	"supervideo/pkg/database"
)

type Zone struct {
	models.BaseModel

	Title  string `json:"title,omitempty"`
	Sort   int8   `json:"sort,omitempty"`
	Status int8   `json:"status,omitempty"`

	models.CommonTimestampsField
}

func (Zone *Zone) Create() {
	database.DB.Create(&Zone)
}

func (Zone *Zone) Save() (rowAffected int64) {
	result := database.DB.Save(&Zone)
	return result.RowsAffected
}

func (zone *Zone) Delete() (rowAffected int64) {
	result := database.DB.Delete(&zone)
	return result.RowsAffected
}
